﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media.Imaging;
using FrameBLL;
using FrameEngine;
using wpfUI.UIs;

namespace wpfUI.ToolAndCommand
{
    public class EditTool : BaseTool
    {
        private readonly IApplication _szApplication;
           /// <summary>
        /// 创建楼块工具
        /// </summary>
        /// <param name="pApplication"></param>
        public EditTool(IApplication pApplication)
            : base(pApplication)
        {
            _szApplication = pApplication;
            ImageSource =
                new BitmapImage(new Uri("/wpfUI;component/Images/测量面积.png", UriKind.RelativeOrAbsolute));
            ToolTip = "编辑";
            Caption = "编辑";
        }
        public override void Select()
        {
            base.Select();
            Application.IsCanChangeTool = false;
            var myDialog = new EditingDialog();
            myDialog.Title = "编辑";
            myDialog.Closed += Dialog_Closed;
            myDialog.Closing += myDialog_Closing;
            myDialog.Left = 50;
            myDialog.Top = 50;
            myDialog.Owner = _szApplication.MainWindow as Window;
            myDialog.Show();
        }

        void myDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
         
        }


        private void Dialog_Closed(object sender, EventArgs e)
        {
            Application.IsCanChangeTool = true;
        }
    }
}
